home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / source / argument.e < prev    next >
Encoding:
Text File  |  1995-12-27  |  891 b   |  52 lines

  1.  
  2. -> Copyright © 1995, Guichard Damien.
  3.  
  4. -> Eiffel routine arguments
  5.  
  6. OPT MODULE
  7. OPT EXPORT
  8.  
  9. MODULE '*strings'
  10. MODULE '*ame'
  11. MODULE '*listed_entity'
  12. MODULE '*class'
  13.  
  14. -> argument
  15. OBJECT argument OF listed_entity
  16.   count:INT
  17. ENDOBJECT
  18.  
  19. -> Create an argument.
  20. PROC create(name) OF argument
  21.   self.name:=name
  22.   self.count:=1
  23. ENDPROC
  24.  
  25. -> Add an entity
  26. PROC add(other:PTR TO argument) OF argument
  27.   DEF previous:PTR TO argument
  28.   WHILE self
  29.     previous:=self
  30.     self:=self.next
  31.   ENDWHILE
  32.   previous.next:=other
  33.   other.set_count(previous.count+1)
  34. ENDPROC
  35.  
  36. -> Set argument type.
  37. PROC set_type(type) OF argument
  38.   self.type:=type
  39. ENDPROC
  40.  
  41. -> Set count of the local (used only by procedure)
  42. PROC set_count(count) OF argument
  43.   self.count:=count
  44. ENDPROC
  45.  
  46. -> Argument value access mode
  47. PROC access() OF argument IS M_ARG
  48.  
  49. -> Index for access to argument value
  50. PROC index() OF argument IS self.count
  51.  
  52.